﻿<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="FuLiao_CaiGou_JiHua_Search.aspx.cs" Inherits="syc.Sale.FuLiao_CaiGou_JiHua_Search" %>

<head runat="server">
    <title></title>
</head>
<body>
    <script type="text/javascript" language="javascript" src="/common.js"></script>

    <form id="form1" runat="server">
    <div id="wintop" class="wintop">查看辅料采购计划</div>
    <asp:Panel ID="Panel1" runat="server" CssClass="panel">
        <asp:Button ID="To" runat="server" Text="导出" CssClass="button" 
            onclick="ToWord_Click" />
        </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" CssClass="panel">
        上报单位：<asp:DropDownList ID="ShengChanDanWei" runat="server" DataTextField="名称" DataValueField="名称" 
            Width="120px">
        </asp:DropDownList>
        上报日期范围：<asp:TextBox ID="Date1" runat="server" CssClass="intxt1" Width="120px" 
            ReadOnly="True"></asp:TextBox>
        <img align="middle" alt="" 
            onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" 
            src="/Icons/29.png" style="height: 16px" /> 至&nbsp;<asp:TextBox ID="Date2" runat="server" 
            CssClass="intxt1" Width="120px" ReadOnly="True"></asp:TextBox>
        <img align="middle" alt="" 
            onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" 
            src="/Icons/29.png" /><br />
        上报计划：<asp:DropDownList ID="JiHua" runat="server" DataSourceID="SqlDataSource2" 
            DataTextField="计划名称" DataValueField="ID" Width="120px" 
            ondatabound="JiHua_DataBound">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT [计划名称], [ID] FROM [辅料采购计划] WHERE (([填报单位] = @填报单位) AND ([填报日期] &gt;= @填报日期) AND ([填报日期] &lt;= @填报日期2))">
            <SelectParameters>
                <asp:ControlParameter ControlID="ShengChanDanWei" Name="填报单位" 
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="Date1" DbType="Date" Name="填报日期" 
                    PropertyName="Text" />
                <asp:ControlParameter ControlID="Date2" DbType="Date" Name="填报日期2" 
                    PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
        &nbsp;&nbsp;&nbsp;<asp:Button ID="Button3" runat="server" Text="筛 选" CssClass="wsbutton" 
            UseSubmitBehavior="False" onclick="Button_Query_Click" />
        
    </asp:Panel>
       <asp:Panel ID="Panel3" runat="server" CssClass="panel2">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
  <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#d0d0d0">
	            <tr>
		            <td class="grid-title"><%=this.ShengChanDanWei.Text %>—(辅料)采购计划</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"  
                              SelectCommand="select 辅料采购明细.ID,辅料采购计划.计划名称,品名,规格,单位,计划采购量,日期 from 辅料采购明细 inner join 辅料采购计划 on 辅料采购计划.ID=辅料采购明细.辅料采购计划ID inner join 辅料 on 辅料.ID=辅料采购明细.辅料ID"
                            ></asp:SqlDataSource>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                             AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                            UseAccessibleHeader="False" DataSourceID="SqlDataSource1" 
                            onrowdatabound="GridView1_RowDataBound" >
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <SelectedRowStyle   CssClass="grid-row-bright" />
                            <Columns>
                             <asp:TemplateField HeaderText="" Visible="False">
                                    <ItemTemplate>
                                        <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                        <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"  
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header" 
                                    ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center" Visible="False" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>
                                
                                <asp:BoundField DataField="品名" HeaderText="辅料名称" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="160" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>
                   
                                <asp:BoundField DataField="规格" HeaderText="规格"  ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="160" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>
                                <asp:BoundField DataField="单位" HeaderText="单位"  ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="160" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>                       
                                <asp:BoundField DataField="计划采购量" HeaderText="计划采购量" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="100" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>
                                 <asp:TemplateField HeaderText="现有库存量"  ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header">

<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid"></ItemStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="采购需求量" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header">
                                    <ItemTemplate>
                                        <asp:TextBox ID="CaiGouXuQiuLiang" runat="server" Width="70px"></asp:TextBox>
                                        <asp:Label ID="lblCaiGouXuQiuLiang" runat="server"></asp:Label>
                                    </ItemTemplate>

<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid"></ItemStyle>
                                </asp:TemplateField>
                                <asp:BoundField DataField="日期" DataFormatString="{0:d}" HeaderText="上报日期" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="100" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>
                            </Columns>
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>   
		                <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>   
<script>
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = function() { this.firstChild.firstChild.click(); };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }

</script>
</form>
</body>
</html>
